<?php

use App\Http\Controllers\Api\TestController;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Response;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

/* OPTIONS method */
Route::options('{all}', function () {
    return Response::make('', 204);
})->where('all', '.*');

Route::namespace('Api')->group(function () {

    Route::get('token', 'UserController@getToken');

    Route::get('mobile', 'UserController@mobile');

    Route::prefix('test')->group(function () {
        Route::get('', 'TestController@index');
    });

    Route::prefix('upload')->group(function() {
        Route::post('', 'UploadImgController@upload');
    });

    Route::prefix('user')->group(function() {
        Route::get('info', 'UserController@getInfo');

        Route::get('collect', 'UserCollectController@collect');
        Route::get('uncollect', 'UserCollectController@uncollect');
    });

    Route::get('banners', 'BannerController@index');
    // 广告接口
    Route::get('advertisings', 'AdvertisingController@index');

    // Route::get('contents/type_list', 'ContentController@getTypeList');
    // Route::get('contents/status_list', 'ContentController@getStatusList');
    Route::get('positions', 'ContentController@getPositions');

    Route::get('contents/refresh', 'ContentController@refreshContent');

    Route::apiResource('contents', 'ContentController')->only(['index', 'store', 'show']);

    Route::get('getResume', 'ResumeController@getResume');

    Route::post('resumes/{resume}', 'ResumeController@update');

    Route::post('resumes', 'ResumeController@store');

    Route::get('messages', 'MessageController@index');

    Route::get('coupons', 'CouponController@index');

});


